﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace TerminationCall.Core
{
    public class Tile
    {
        private Bitmap _bitmap;

        public Tile() {

            ChildTileField = new TileField();

        }

        public Bitmap Bitmap
        {
            get
            {
                return _bitmap;
            }
        }

        public int NumberX {
            get;
            private set;
        }

        public int NumberY {
            get;
            private set;
        }
        
        public TileField ChildTileField {
            get;
            private set;
        }

        public Tile ParentTile {
            get;
            set;
        }

        public TileFields TileFields {
            get;
            set;
        }

        public TileSet TileSet {
            get;
            set;
        }

        public void SetBitmap(TileSet tileSet, int x, int y) {
            _bitmap = new Bitmap(20, 16);
            Graphics tileSetGraphic = Graphics.FromImage(_bitmap);
            tileSetGraphic.DrawImage(tileSet.Bitmap, 0, 0, new Rectangle(x * 20, y * 16, 20, 16), GraphicsUnit.Pixel);
            NumberX = x;
            NumberY = y;
        }

    }
}
